<script type="text/javascript" src="<?php echo base_url(); ?>resource/script/baitap.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>resource/css/bangdiem.css">

<div id="content">
    <?php if($baitap) : $dem = 0 ?>
    <input type="hidden" id="mabt" value="<?php echo $mabaitap; ?>">
    <div class="danhsachgopy">Bài Tập: <?php echo $tenbaitap; ?></div>
    <form>
        <div id="thoigian" class="thoigian">Thời gian còn lại<div class="cangiua">60:00 phút</div></div>
        <div class="block" style="padding: 20px;">
            <table class="table table-bordered">
            <?php foreach ($baitap as $value) : $dem++ ?>
                <tr>
                    <td style="background-color: #d9edf7;font-weight: bold;">Câu <?php echo $value->cau.": ".$value->noidung; ?></td>
                </tr>
                <tr>
                    <td><input type="radio" name="cau<?php echo $value->cau; ?>" value="<?php echo $value->a; ?>" style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>a"><label for="cau<?php echo $value->cau; ?>a">a. <?php echo $value->a; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" name="cau<?php echo $value->cau; ?>" value="<?php echo $value->b; ?>" style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>b"><label for="cau<?php echo $value->cau; ?>b">b. <?php echo $value->b; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" name="cau<?php echo $value->cau; ?>" value="<?php echo $value->c; ?>" style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>c"><label for="cau<?php echo $value->cau; ?>c">c. <?php echo $value->c; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" name="cau<?php echo $value->cau; ?>" value="<?php echo $value->d; ?>" style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>d"><label for="cau<?php echo $value->cau; ?>d">d. <?php echo $value->d; ?></label></td>
                </tr>
                <tr>
                    <td><span id="<?php echo 'ketqua'.$value->cau; ?>"></span></td>
                </tr>
            <?php endforeach; ?>
            </table>
        </div>
        <input type="hidden" id="base_url" value="<?php echo base_url(); ?>">
        <input type="hidden" id="dem" value="<?php echo $dem; ?>">
        <center>
            <button type="button" class="btn btn-default" id="hoantat">
                <img style="width: 30px;height: 30px;margin: 5px;" src="<?php echo base_url(); ?>resource/images/quanly/edit.png"/>
                <span style="font-weight: bold;color: #28a4c9">NỘP BÀI</span>
            </button>
        </center>
    </form>
    
    <?php else : ?>
    <h4>Bài tập không tồn tại hoặc đã bị xóa!!!</h4>
    <?php endif; ?>
</div>

<div id="bangdiem_bg"></div>
<div id="bangdiem">
    <div id="diem"></div>
    <input type="button" value="Xem lại bài" class="btn" id="xemlai">
</div>